<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
	</head>
	<body>
		<div id="app">
			计数器:<counter></counter>
			计数器:<counter></counter>
			计数器:<counter></counter>
		</div>
		
		<script>
			var app = Vue.createApp({
				data(){
					return {
						message:"Hello World!",
					}
				}
			})
			
			// 注册一个全局组件
			app.component('counter',{
				// data数据
				data(){
					return {
						count: 0,
					}
				},
				// template模板
				template: "<button @click='count++'>{{count}}</button>"
				// methods
				
			})
			
			var vm = app.mount("#app")
		</script>
	</body>
</html>
